package com.pk.flink.apps.datasource;


import com.pk.flink.bean.Account;
import com.pk.flink.source.MySqlParallelStudentSource;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * 使用Flink 实现单词计数
 * @author pk
 */
public class FlinkMySqlCustomDataSourceApp {
    public static void main(String[] args) throws Exception {
        //获取上下文环境
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        DataStreamSource<Account> accessDataStreamSource = env.addSource(new MySqlParallelStudentSource());
        System.out.println(accessDataStreamSource.getParallelism());
        accessDataStreamSource.print();

        env.execute();

    }
}
